<?php 
include($GLOBALS['PAD']."Modules/Support/Front/requests/op.req.php");
	if (!isset($_POST['AddRequest']) && !isset($_POST['AddArticle'])) {
	?>
	<table width="100%"  border="0" cellpadding="3" cellspacing="1">
  <form action="?action=requests" method="post" name="addRequest" runat="server">
    <tr bgcolor="#99CCCC">
      <td width="60%" bgcolor="#ACB1CC">
	  <input name="AddRequest" type="submit" id="AddRequest" value="Novo Pedido"></td>
    </tr>
  </form>
</table>
<?php 
} elseif (isset($_POST['AddRequest']) || isset($_POST['AddArticle'])) {
	include($GLOBALS['PAD']."Modules/Support/Front/requests/requests.php");
}
?>
<br>
<table width="100%"  border="0" cellpadding="3" cellspacing="1">
    <tr bgcolor="#ACB1CC">
      <td colspan="9">Pedidos</td>
    </tr>
  <tr bgcolor="#F2F2F2" onMouseOver="bgcolor='#FFFFFF'">
    <td width="10%" onMouseOver="bgcolor='#FFFFFF'">Funcionário</td>
    <td width="40%" bgcolor="#F2F2F2">ObservaÇ&otilde;es</td>
    <td width="8%">Estado</td>
    <td width="14%">Criado</td>
    <td width="14%">Entregue</td>
    <td width="14%">Aprovado</td>
  </tr>
</table>
<div id="Layer1" style="position:relative; width:100%; height:300px; z-index:1; overflow: auto;">
  <table width="98%"  border="0" cellpadding="3" cellspacing="1">
    <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="get" name="getInvoices" runat="server">
    </form>
    <?php
    $CResults = "SELECT 
					ccenter_requests.RefUser,
					ccenter_requests.Observations,
					ccenter_requests.Status,
					ccenter_requests.TimeCreated,
					ccenter_requests.TimeDelivered,
					ccenter_requests.RefSupervisor
				FROM ccenter_requests
				WHERE RefOffice = {$_SESSION['office']}
				AND Status > 0
				ORDER BY ccenter_requests.TimeCreated DESC";
	$Results = $GLOBALS['CONN']->db_array($CResults); 
	for ($f = 1; $f <= $Results[0]; $f++) { 
	
		echo '<tr bgcolor="#D3D6E4">
		<td width="10%">'.$Results[$f]['RefUser'].'</td>
		<td width="40%">'.$Results[$f]['Observations'].'</td>
		<td width="8%">'.$Results[$f]['Status'].'</td>
		<td width="14%">'.$Results[$f]['TimeCreated'].'</td>
		<td width="14%">'.$Results[$f]['TimeDelivered'].'</td>
		<td width="14%">'.$Results[$f]['RefSupervisor'].'</td>
		</tr>';
   } ?>
  </table>
</div>